package view.component.render
{
import framework.view.components.button.StateButtonProxy;
import framework.view.components.container.RepeaterRenderProxy;

/**
 * SelectableItemRenderProxy
 * @author jliang
 *
 */
public class SelectableItemRenderProxy extends RepeaterRenderProxy
{
    //==========================================================================
    //  Constructor
    //==========================================================================
    public function SelectableItemRenderProxy()
    {
        super();
    }
    
    //==========================================================================
    //  Variables
    //==========================================================================
    protected function get buttonSkin():String
    {
        return "";
    }	
    //==========================================================================
    //  Properties
    //==========================================================================    
    public function get btn():StateButtonProxy
    {
        return proxys["btn"];
    }
    //==========================================================================
    //  Overridden methods: RepeaterRenderProxy
    //==========================================================================	
    override public function set selected(value:Boolean):void
    {
        btn.selected = value;
    }
    
    override public function get selected():Boolean
    {
        return btn.selected;
    }
    
    override protected function get proxyMapping():Array
    {
        return [ 
            { skin:buttonSkin, classRef: StateButtonProxy, id:"btn", onSelected: onClickHandler, onMouseOut: onMouseOutHandler, onMouseOver: onMouseOverHandler }
        ];
    }
    
    protected function onClickHandler():void
    {
        
    }
    
    protected function onMouseOutHandler():void
    {
        
    }
    
    protected function onMouseOverHandler():void
    {
        
    }
}
}